import java.util.Arrays;
import java.util.Comparator;

class Student implements Comparable<Student> {
    public String name;
    public int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
//    @Override
//    public int compareTo(Student o) {
//        return this.name.compareTo(o.name);
//    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }
}
    public class Test1 {
        public static void main1(String[] args) {
            Student student1 = new Student("zhangsan", 12);
            Student student2 = new Student("lisi", 15);
            if (student1.compareTo(student2) > 0) {
                System.out.println("student1 > student2");
            } else {
                System.out.println("student1 <= student2");
            }
        }
    }
